#ifndef _LIBCONFIGPARSER_H
#define _LIBCONFIGPARSER_H
/********************************************
********* libxml2 includes ******************
********************************************/
#include <libxml/xmlreader.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
/*******************************************
********* END libxml2 includes *************
*******************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h> // needed for string manipulation
enum mode { //enumeration to determine the mode to run in

STANDALONE = 0,
CLIENT = 1,
SERVER = 2,
MANAGER = 3

};
typedef struct {

	char *logfile;
	int blocktime;
	char maxtries;	

} defaults;

struct ignore_networks {
	char *ip;
};
typedef struct {

  enum mode STANDALONE;
  char syslog[25];
  char logfile; //= "/var/log/syslog";
  char ipv6; // support ipv6 by default
  char *ipv6_block_net; // do NOT block ipv6 networks by default
  struct ignore_networks *ignore; // translates to an array of IPs to never block! don't forget to malloc/realloc! MAY include ipv6 addresses/networks like ::1/64 or ::1
  int loglevel; // SYSLOG loglevel	

} sysconfig;


struct service {

	char *name;
	char *logfile;
	int block_time;
	char maxtries;
	int port; // NULL is equiv to all!
	struct service *next; // make this a list;

};

struct service myconfig;
struct service *mycfgPtr;


xmldoc* OpenConfig(const char *filename, const char *encoding = NULL, int options = 0);

xmlnode* getRoot(*xmldoc);

xmlnode *getNextNode(*xmlnode); 
#endif // _LIBCONFIGPARSER_H
